package com.flying.invest.strategy.model;

import com.flying.framework.annotation.ConstantEnum;
import com.flying.framework.annotation.Param;
import com.flying.framework.data.Data;
import com.flying.framework.data.DataSerializable;
import com.flying.framework.metadata.Meta;

@SuppressWarnings("serial")
@Meta(id="i_strategy_value_average",title="价值平均策略", table="i_strategy_value_average", primaryKeys={"strategy_id"})
public class StrategyValueAverage extends Data implements DataSerializable {
	public final static String ENTITY_NAME = "i_strategy_value_average";
	
	public final static String STRATEGY_ID = "strategy_id";
	public final static String TARGET_AMOUNT = "target_amount";
	public final static String INFLATION_RATE = "inflation_rate";
	public final static String RISE_AMOUNT = "rise_amount";
	public final static String RISE_RATE = "rise_rate";
	public final static String RISE_COND = "rise_cond";
	public final static String FELL_RATE = "fell_rate";
	public final static String FELL_AMOUNT = "fell_amount";
	public final static String FELL_COND = "fell_cond";

	public enum TriggerCondition implements ConstantEnum<Integer> {
		AMOUNT(1, "金额满足"), RATE(2, "比率满足"), AMOUNT_OR_RATE(3, "任一满足"), AMOUNT_AND_RATE(4, "所有满足");

		public final int value;
		public final String remarks;

		TriggerCondition(int value, String remarks) {
			this.value = value;
			this.remarks = remarks;
		}
		
		@Override
		public Integer value() {
			return this.value;
		}

		@Override
		public String text() {
			return remarks;
		}
	}
	
	
	@Param(value=STRATEGY_ID,   required=true,   maxlength=0,	desc="策略ID")
	private Long strategyId;
	
	@Param(value=TARGET_AMOUNT,   required=true,   maxlength=0,	desc="目标市值" )
	private Double targetAmount;
	
	@Param(value=INFLATION_RATE,   required=false,   maxlength=0,	desc="时间成本率" )
	private Double inflationRate;
	
	@Param(value=RISE_AMOUNT,   required=false,   maxlength=0,	desc="上涨金额" )
	private Double riseAmount;
	
	@Param(value=RISE_RATE,   required=false,   maxlength=0,	desc="上涨比率" )
	private Double riseRate;
	
	@Param(value=RISE_COND,   required=false,   maxlength=0,	desc="上升条件（1：任一；2：都满足）" )
	private Integer riseCond;
	
	@Param(value=FELL_RATE,   required=false,   maxlength=0,	desc="下跌比率" )
	private Double fellRate;
	
	@Param(value=FELL_AMOUNT,   required=false,   maxlength=0,	desc="下跌金额" )
	private Double fellAmount;
	
	@Param(value=FELL_COND,   required=false,   maxlength=0,	desc="下跌条件（1：任一；2：都满足）" )
	private Integer fellCond;
	
	
	public Long getStrategyId() {
		return this.strategyId;
	}
	
	public void setStrategyId(Long strategyId) {
		this.strategyId = strategyId;
	}
	
	public Double getTargetAmount() {
		return this.targetAmount;
	}
	
	public void setTargetAmount(Double targetAmount) {
		this.targetAmount = targetAmount;
	}
	
	public Double getInflationRate() {
		return this.inflationRate;
	}
	
	public void setInflationRate(Double inflationRate) {
		this.inflationRate = inflationRate;
	}
	
	public Double getRiseAmount() {
		return this.riseAmount;
	}
	
	public void setRiseAmount(Double riseAmount) {
		this.riseAmount = riseAmount;
	}
	
	public Double getRiseRate() {
		return this.riseRate;
	}
	
	public void setRiseRate(Double riseRate) {
		this.riseRate = riseRate;
	}
	
	public Integer getRiseCond() {
		return this.riseCond;
	}
	
	public void setRiseCond(Integer riseCond) {
		this.riseCond = riseCond;
	}
	
	public Double getFellRate() {
		return this.fellRate;
	}
	
	public void setFellRate(Double fellRate) {
		this.fellRate = fellRate;
	}
	
	public Double getFellAmount() {
		return this.fellAmount;
	}
	
	public void setFellAmount(Double fellAmount) {
		this.fellAmount = fellAmount;
	}
	
	public Integer getFellCond() {
		return this.fellCond;
	}
	
	public void setFellCond(Integer fellCond) {
		this.fellCond = fellCond;
	}
	

}